// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import "babel-polyfill";
import Vue from "vue";
import App from "./App";
import store from "./store";
import router from "./router";
import plugins from './plugins' // plugins
import ElementUI from "element-ui";
import "./assets/img/iconfont/iconfont.css";
import "./assets/theme-chalk/index.css";
import 'element-ui/lib/theme-chalk/index.css';
import Echarts from "echarts";
import Jquery from "jquery";
import "@/icons";
import VueClipboards from "vue-clipboards";
import VueDND from "awe-dnd";
import axios from "axios";
// import { download } from "@/utils/request";
Vue.use(ElementUI);
Vue.use(Echarts);
Vue.use(VueClipboards);
Vue.use(VueDND);
Vue.use(plugins)
Vue.prototype.$echarts = Echarts;
Vue.prototype.$bus = new Vue();
Vue.prototype.$ = Jquery;
Vue.prototype.$axios = axios;
Vue.config.productionTip = false;
// Vue.prototype.download = download;
/* eslint-disable no-new */


Vue.prototype.resetSetItem = function (key, newVal) {
  if (key === 'clickToolsProjectName') {
    // 创建一个StorageEvent事件
    var newStorageEvent = document.createEvent('StorageEvent');
    const storage = {
      setItem: function (k, val) {
        sessionStorage.setItem(k, val);
        // 初始化创建的事件
        newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null, null);
        // 派发对象
        window.dispatchEvent(newStorageEvent)
      }
    }
    return storage.setItem(key, newVal);
  }
}


new Vue({
  el: "#app",
  store,
  router,
  components: { App },
  template: "<App/>"
});
